#!/bin/bash

# 切换到HBase目录
cd /usr/local/hbase
if [ $? -ne 0 ]; then
    echo "错误：无法进入/usr/local/hbase目录！"
    exit 1
else
    echo "成功进入/usr/local/hbase目录"
fi

# 启动HBase服务
bin/start-hbase.sh
if [ $? -ne 0 ]; then
    echo "错误：HBase服务启动失败！"
    exit 1
else
    echo "HBase服务启动成功"
fi

# 进入HBase Shell
bin/hbase shell
if [ $? -ne 0 ]; then
    echo "错误：无法进入HBase Shell！"
    exit 1
else
    echo "成功进入HBase Shell"
fi